package com.yanfan.energy.service;


import com.yanfan.attach.domain.DeviceDetail;
import com.yanfan.common.core.domain.AjaxResult;
import com.yanfan.energy.domain.EconomicalBody;
import com.yanfan.energy.domain.model.ComboBoxBody;
import com.yanfan.energy.domain.model.ComboBoxBodyVo;
import com.yanfan.energy.domain.statist.DateStatistics;
import com.yanfan.energy.domain.statist.EnergyMaxStatistics;
import com.yanfan.energy.domain.statist.WorkshopStatistics;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * 车间能耗分析模块接口
 *
 * @author caijinkang
 * @since 2022-09-26 13:57:15
 */
public interface WorkshopEnergyService {
    /**
     * 耗水统计
     *
     * @param workshopId 车间编号
     * @param floorId    楼层编号
     * @param buildingId 楼栋编号
     * @param range      日/周/月
     * @param begin      开始时间
     * @param end        结束时间
     * @param unit       单位
     * @return java.util.Map<java.lang.String, java.util.List < io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>>
     * @author caijinkang
     * @date 2022/9/26 15:07
     */
    Map<String, List<DateStatistics>> findConsumeWater(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 耗气统计
     *
     * @param workshopId 车间编号
     * @param floorId    楼层编号
     * @param buildingId 楼栋编号 bhu8
     * @param range      日/周/月
     * @param begin      开始时间
     * @param end        结束时间
     * @param unit       单位
     * @return java.util.Map<java.lang.String, java.util.List < io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>>
     * @author caijinkang
     * @date 2022/9/26 15:07
     */
    Map<String, List<DateStatistics>> findGasConsumption(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 时段用电总量
     *
     * @param workshopId 车间编号
     * @param floorId    楼层编号
     * @param buildingId 楼栋编号
     * @param range      日/周/月
     * @param begin      开始时间
     * @param end        结束时间
     * @param unit       单位
     * @return java.util.Map<java.lang.String, java.util.List < io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>>
     * @author caijinkang
     * @date 2022/9/26 15:07
     */
    Map<String, List<DateStatistics>> findTotalElectricity(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 空调热能
     *
     * @param workshopId 车间编号
     * @param floorId    楼层编号
     * @param buildingId 楼栋编号
     * @param range      标识
     * @param begin      开始时间
     * @param end        结束时间
     * @param unit       单位
     * @return java.util.Map<java.lang.String, java.util.List < io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>>
     * @author caijinkang
     * @date 2022/9/26 15:07
     */
    Map<String, List<DateStatistics>> findAirConditioner(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 能耗排名
     *
     * @param workshopId 车间编号
     * @param floorId    楼层编号
     * @param buildingId 楼栋编号
     * @param range      标识
     * @param begin      开始时间
     * @param end        结束时间
     * @param unit       单位
     * @return java.util.Map<java.lang.String, java.util.List < io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>>
     * @author caijinkang
     * @date 2022/9/26 15:07
     */
    Map<String, List<DateStatistics>> findEnergyStatistics(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 车间能耗对比
     *
     * @param workshopStatistics
     * @param begin              开始时间
     * @param end                结束时间
     * @param unit               单位
     * @return java.util.Map<java.lang.String, java.util.List < io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>>
     * @author caijinkang
     * @date 2022/9/26 15:15
     */
    EnergyMaxStatistics findWorkshopComparison(List<WorkshopStatistics> workshopStatistics, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 车间能耗对比，改良表，加上设备id对比
     *
     * @param workshopStatistics
     * @param begin
     * @param end
     * @param unit
     * @return com.ruoyi.common.core.domain.model.EnergyMaxStatistics
     * @author caijinkang
     * @date 2023/3/24 11:39
     */
    EnergyMaxStatistics finWorkshopComparisonRevise(List<WorkshopStatistics> workshopStatistics, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 查询时间范围的统计
     *
     * @param dates
     * @param statistics
     * @return java.util.List<io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>
     * @author caijinkang
     * @date 2022/9/27 15:12
     */
    List<DateStatistics> findDateStatistics(List<String> dates, List<DateStatistics> statistics);

    /**
     * 查询能耗分类
     *
     * @return java.util.List<java.lang.String>
     * @author caijinkang
     * @date 2022/10/10 14:10
     */
    List<DateStatistics> findClassify();

    /**
     * 查看能耗类型
     *
     * @param cId
     * @return java.util.List<java.lang.String>
     * @author caijinkang
     * @date 2022/10/10 14:10
     */
    List<DateStatistics> findTypological(Integer cId);

    /**
     * 查看能耗类型的代表
     *
     * @param cId
     * @return java.util.List<io.github.jhipster.sample.sansheng.tool.statistics.DateStatistics>
     * @author caijinkang
     * @date 2022/10/11 17:13
     */
    List<DateStatistics> findTypologicalType(int cId);

    /**
     * 查找公共车间的部分的用电量
     *
     * @param spikes
     * @param peaks
     * @param parity
     * @param lowEbb
     * @param range
     * @param begin
     * @param end
     * @param unit
     * @param dates
     * @param dateTime
     * @return java.util.Map<java.lang.String, java.util.List < com.ruoyi.common.core.domain.model.DateStatistics>>
     * @author caijinkang
     * @date 2023/5/11 13:05
     */
    Map<String, List<DateStatistics>> findElectricityByCount(List<DateStatistics> spikes, List<DateStatistics> peaks, List<DateStatistics> parity, List<DateStatistics> lowEbb, String range, LocalDate begin, LocalDate end, Integer unit, List<String> dates, String dateTime);

    /**
     * 查看能源采购类
     *
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/3/24 10:30
     */
    AjaxResult findPurchasing();

    /**
     * 能源介质下拉框
     *
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/3/29 14:02
     */
    AjaxResult findEnergyTypeId();

    /**
     * 查询能源采购的本年的数据
     *
     * @param range
     * @param workshopId
     * @param floorId
     * @param buildingId
     * @param begin
     * @param end
     * @param unit
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/11 13:05
     */
    AjaxResult purchaseByRange(String range, Integer workshopId, Integer floorId, Integer buildingId, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 查询能源水、电、气、采购的本月的数据
     *
     * @param range
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/4/21 11:00
     */
    AjaxResult purchaseByMonth(String range);

    /**
     * 查询省钱管理的数据概览
     *
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/8 14:48
     */
    AjaxResult findDataOverview();

    /**
     * 查询省钱管理的数据趋势
     *
     * @param range
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/8 14:52
     */
    AjaxResult findDataTrend(String range);

    /**
     * 查询本月节省占比
     *
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/8 15:59
     */
    AjaxResult findSavingsRatio();

    /**
     * 查询省钱数据列表
     *
     * @param economicalBody
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/8 16:21
     */
    AjaxResult findSaveMoneyData(EconomicalBody economicalBody);

    /**
     * 查询本月谷电运行占比
     *
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/8 16:31
     */
    AjaxResult findLowEbbProportion();

    /**
     * 查询省钱月份排名
     *
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/8 16:34
     */
    AjaxResult findSaveMoneyMonthlyRanking();

    /**
     * 查询本月的水费、电费、气费
     *
     * @return java.util.Map<java.lang.String, java.util.List < com.ruoyi.common.core.domain.model.DateStatistics>>
     * @author caijinkang
     * @date 2023/5/9 15:41
     */
    Map<String, List<DateStatistics>> findBroadEnergyPrice();

    /**
     * 查询本日的总费用、水费、电费、气费、采购费
     *
     * @return com.ruoyi.common.core.domain.AjaxResult
     * @author caijinkang
     * @date 2023/5/11 17:06
     */
    AjaxResult findAllEnergyByDay();

    Map<String, Map<String, Double>> purchaseStatistics(Integer buildingId, Integer floorId, Integer workshopId, Long deviceId, String deviceName, String range, LocalDate parse, LocalDate parse1, Integer unit);

    Map<String, Double> purchaseStatisticsPie(Integer buildingId, Integer floorId, Integer workshopId, Long deviceId, String deviceName, String range, LocalDate parse, LocalDate parse1, Integer unit);

    /**
     * 查看新能耗分析-能耗费用
     *
     * @param workshopId
     * @param floorId
     * @param buildingId
     * @param deviceId
     * @param range
     * @param begin
     * @param end
     * @param unit
     * @return java.util.Map<java.lang.String, java.util.List < com.ruoyi.common.core.domain.model.DateStatistics>>
     * @author caijinkang
     * @date 2023/6/2 10:34
     */
    Map<String, List<DateStatistics>> findEnergyCostStatistics(Integer workshopId, Integer floorId, Integer buildingId, Integer deviceId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 查询耗水占比
     *
     * @param workshopId
     * @param floorId
     * @param buildingId
     * @param range
     * @param begin
     * @param end
     * @param unit
     * @return java.util.List<com.ruoyi.common.core.domain.model.DateStatistics>
     * @author caijinkang
     * @date 2023/6/2 13:37
     */
    List<DateStatistics> findWaterByPieDiagrams(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 查询耗电占比
     *
     * @param workshopId
     * @param floorId
     * @param buildingId
     * @param range
     * @param begin
     * @param end
     * @param unit
     * @return java.util.List<com.ruoyi.common.core.domain.model.DateStatistics>
     * @author caijinkang
     * @date 2023/6/2 13:37
     */
    List<DateStatistics> findElectricByPieDiagrams(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);

    /**
     * 查询耗气占比
     *
     * @param workshopId
     * @param floorId
     * @param buildingId
     * @param range
     * @param begin
     * @param end
     * @param unit
     * @return java.util.List<com.ruoyi.common.core.domain.model.DateStatistics>
     * @author caijinkang
     * @date 2023/6/2 13:38
     */
    List<DateStatistics> findGasByDiagrams(Integer workshopId, Integer floorId, Integer buildingId, String range, LocalDate begin, LocalDate end, Integer unit);


    List<ComboBoxBody> listsByDeviceComboBox(DeviceDetail device);

    List<ComboBoxBodyVo> listsByDeviceComboBoxCop(DeviceDetail device);
}
